﻿using System;
using Microsoft.Xna.Framework;
using Terraria.Localization;

namespace Terraria.ModLoader
{
	// Token: 0x020001C8 RID: 456
	internal class PlayerCommandCaller : CommandCaller
	{
		// Token: 0x06001300 RID: 4864 RVA: 0x0000FB71 File Offset: 0x0000DD71
		public PlayerCommandCaller(Player player)
		{
			this.Player = player;
		}

		// Token: 0x1700015F RID: 351
		// (get) Token: 0x06001301 RID: 4865 RVA: 0x0000FB80 File Offset: 0x0000DD80
		public CommandType CommandType
		{
			get
			{
				return CommandType.Server;
			}
		}

		// Token: 0x17000160 RID: 352
		// (get) Token: 0x06001302 RID: 4866 RVA: 0x0000FB83 File Offset: 0x0000DD83
		public Player Player { get; }

		// Token: 0x06001303 RID: 4867 RVA: 0x0040F028 File Offset: 0x0040D228
		public void Reply(string text, Color color = default(Color))
		{
			if (color == default(Color))
			{
				color = Color.White;
			}
			foreach (string text2 in text.Split(new char[]
			{
				'\n'
			}))
			{
				NetMessage.SendChatMessageToClient(NetworkText.FromLiteral(text2), color, this.Player.whoAmI);
			}
		}
	}
}
